﻿using Microsoft.Practices.Unity;
using System.Web;
namespace AprenderComendo.Infrastructure
{
    public class HttpContextLifetimeManager : LifetimeManager
    {
        public static string Key
        {
            get { return "NHSession"; }  
        } 

        public override object GetValue()
        {
            return HttpContext.Current.Items[Key];
        }

        public override void SetValue(object newValue)
        {
            HttpContext.Current.Items[Key] = newValue;
        }

        public override void RemoveValue()
        {
        }
    }
}